package grug.tian.minispringmvc.controller;

import grug.tian.minispringmvc.annotation.Autowired;
import grug.tian.minispringmvc.annotation.Controller;
import grug.tian.minispringmvc.annotation.RequestMapping;
import grug.tian.minispringmvc.annotation.RequestParam;
import grug.tian.minispringmvc.service.HelloService;

/**
 * @author Grug.Tian
 * @date 2020/11/17 16:57
 */
@Controller
public class HelloController {

  @Autowired
  private HelloService helloService;

  @RequestMapping("/")
  public String index() {
    return "Power by mini SpringMVC";
  }

  @RequestMapping("/hello")
  public String hello(@RequestParam("name") String name) {
    return helloService.sayHello(name);
  }

}
